package com.rest.impl;

import java.io.InputStream;

import com.rest.model.HttpStatus;
import com.rest.model.RestRequest;
import com.rest.model.RestResponse;

public class RestResponseImpl implements RestResponse {

	private final RestRequest request;
	private final HttpStatus status;
	private final String body;
	private final InputStream content;

	public RestResponseImpl(RestRequest request, int code, String body, InputStream content) {
		this.request = request;
		this.status = HttpStatus.valueOf(code);
		this.body = body;
		this.content = content;
	}

	@Override
	public String getBody() {
		return body;
	}

	@Override
	public InputStream getContent() {
		return content;
	}

	@Override
	public RestRequest getRequest() {
		return request;
	}

	@Override
	public HttpStatus getStatus() {
		return status;
	}
}
